/*    */ package com.lmpop.createIndex.search;
/*    */ 
/*    */ import com.lmpop.createIndex.searchModel.Queue;
/*    */ import com.lmpop.createIndex.searchModel.QueueValue;
/*    */ import com.lmpop.createIndex.searchModel.SearchData;
/*    */ import com.lmpop.createIndex.searchModel.SearchModel;
/*    */ import java.io.IOException;
/*    */ import java.util.ArrayList;
/*    */ import java.util.Hashtable;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ public class SearchKeyIndexFiles
/*    */ {
/*    */   public ProperUtil properUtil;
/*    */   private String file_path;
/*    */ 
/*    */   public SearchKeyIndexFiles()
/*    */   {
/* 21 */     this.properUtil = new ProperUtil();
/* 22 */     this.file_path = this.properUtil.getFilePathByModel("searchkey");
/*    */   }
/*    */ 
/*    */   public List getSearchKeyInfo(Map paraMap) throws IOException {
/* 26 */     ArrayList showList = new ArrayList();
/* 27 */     SearchData search = new SearchData();
/* 28 */     ArrayList paraList = new ArrayList();
/*    */ 
/* 30 */     String key_type = ""; String up_ch_id = ""; String ch_level = "";
/*    */ 
/* 33 */     if (paraMap.get("key_type") != null) key_type = paraMap.get("key_type").toString();
/*    */ 
/* 35 */     Queue queue = new Queue(new QueueValue[] { new QueueValue("location", 2, true) });
/*    */ 
/* 38 */     paraList.add(new SearchModel("0", "key_type", key_type));
/* 39 */     showList = search.getSearchInfo(this.file_path, paraList, queue);
/* 40 */     return showList;
/*    */   }
/*    */ 
/*    */   public ArrayList<Hashtable<String, String>> getKeyWordList(String key, String key_type, int limit)
/*    */     throws IOException
/*    */   {
/* 46 */     SearchData search = new SearchData();
/*    */ 
/* 48 */     ArrayList paraList = new ArrayList();
/* 49 */     paraList.add(new SearchModel("0", "key_type", key_type));
/* 50 */     paraList.add(new SearchModel("0", "key_word", key));
/*    */ 
/* 52 */     ArrayList keywordList = new ArrayList();
/* 53 */     Queue queue = new Queue(new QueueValue[] { new QueueValue("location", 2, true) });
/* 54 */     ArrayList keyList = search.getSearchInfo(this.file_path, paraList, queue);
/*    */ 
/* 56 */     if ((keyList != null) && (keyList.size() > 0)) {
/* 57 */       for (int i = 0; i < keyList.size(); i++)
/*    */       {
/* 59 */         if (i == limit) {
/*    */           break;
/*    */         }
/* 62 */         Hashtable map = (Hashtable)keyList.get(i);
/* 63 */         String key_word = map.get("key_word").toString();
/* 64 */         Hashtable mapkey = new Hashtable();
/* 65 */         mapkey.put("key_word", key_word);
/* 66 */         keywordList.add(mapkey);
/*    */       }
/*    */     }
/*    */ 
/* 70 */     return keywordList;
/*    */   }
/*    */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.createIndex.search.SearchKeyIndexFiles
 * JD-Core Version:    0.6.0
 */